package com.chen.wxchat.service.impl;

import com.chen.wxchat.dao.AnswerListDao;
import com.chen.wxchat.entity.AnswerList;
import com.chen.wxchat.service.AnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AnswerServiceImpl implements AnswerService {
    @Autowired
    private AnswerListDao answerListDao;

    @Override
    public List<AnswerList> getAnswerList(String answerContent) {
        return answerListDao.queryAnswerList(answerContent);
    }

    @Override
    public boolean addAnswer(AnswerList answerList) {
        return (answerListDao.insertAnswer(answerList) > 0);
    }

    @Override
    public List<AnswerList> getAnswerListBytypeId(String typeId) {
        return answerListDao.queryAnswerListBytypeId(typeId);
    }
}
